<?php
//$tenfile='temp.xls';
header('Content-type: application/xls');
header("Content-Disposition:attachment;filename=kenh.xls");
?>
<table>
            <tr><td colspan="3" align="center" style="font-weight: bold; ">
<? echo $tendv[0]['zdvs'] ['tendvcha'];?>
            </td>
            <td colspan="3" align="center" style="font-weight: bold; ">CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM</td>
            </tr>
            <tr>
            <td colspan="3" align="center" style="font-weight: bold; ">
             <?php
echo $tendv[0]['zdvs'] ['tendv'];
?>
            
             </td>
                <td colspan="3" align="center" style="font-weight: bold; ">Độc lập- tự do- hạnh phúc</td>
            </tr>
            <tr>
            <td colspan="6" align="center" >
            <h3 align="center">Các kênh bán hàng Của Trung Tâm
           
            </h3>
            </td>
            </tr>
    </table>
<div class="index">
    <?php echo 'Hiện gồm '.count($kenhs).' kênh';?>
	<table cellpadding="0" cellspacing="0" border="1">
	<tr>
			<th style="background: #d5d5d5; font-weight: bold"><?php echo 'STT';?></th>
			<th style="background: #d5d5d5; font-weight: bold"><?php echo 'Mã kênh';?></th>
			<th style="background: #d5d5d5; font-weight: bold"><?php echo 'Tên kênh';?></th>
			<th style="background: #d5d5d5; font-weight: bold"><?php echo 'Địa chỉ';?></th>
			<th style="background: #d5d5d5; font-weight: bold"><?php echo 'SĐT';?></th>
			<th style="background: #d5d5d5; font-weight: bold"><?php echo 'Loại Kênh';?></th>
			
	</tr>
	<?php
	$i = 0;$stt=0;
	foreach ($kenhs as $kenh):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $stt=$stt+1; ?>&nbsp;</td>
		<td><?php echo $kenh['Kenh']['makenh']; ?>&nbsp;</td>
		<td><?php echo $kenh['Kenh']['tenkenh']; ?>&nbsp;</td>
		<td><?php echo $kenh['Kenh']['diachi']; ?>&nbsp;</td>
		<td><?php echo $kenh['Kenh']['sdt']; ?>&nbsp;</td>
		<td><?php echo $kenh['Loaikenh']['loaikenh']; ?>&nbsp;</td>
	
	</tr>
<?php endforeach; ?>
	</table>
	
	
</div>
